package cn.service.web;

import cn.service.entiy.Goods;
import cn.service.service.GoodsService;
import com.lmk.core.web.support.api.RequestResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("api/goods")
public class GoodsController {

    @Autowired
    private GoodsService goodsService;

    @PostMapping("add")
    public Boolean addGoods(@RequestBody Goods goods){
        return goodsService.add(goods);
    }

    @PostMapping("getGoods")
    public Goods getGoods(@RequestBody Integer goodsId){
        return goodsService.getGoodsById(goodsId);
    }

}
